package com.template.templateuser.auth.serviceauth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
@Configuration
public class ResouceServerConfig extends ResourceServerConfigurerAdapter {
    @Override
    public void configure(HttpSecurity http) throws Exception {
        http
                .authorizeRequests()
                //  .antMatchers("/users/user/logout").permitAll().
                .antMatchers("/users/getVerifyCode").permitAll()
                .antMatchers("/v2/api-docs", "/favicon.ico", "/webjars/**", "/csrf", "/swagger**",
                        "/swagger-resources/**", "/course/coursebase/**", "/hystrix**", "/hystrix/**", "/proxy.stream",
                        "/organization/{id}/is-available", "/actuator/**", "/actuator", "/druid/**", "/druid",
                        "/order/delivery/{id}/evaluation","/cache","/db","/webservices/**","/**/**")
                .permitAll()
                .anyRequest().authenticated();
    }
}
